<script setup lang="ts">
import { ref, reactive, toRaw, onMounted, onBeforeUnmount } from "vue";
import apiService from "@/services/apiService";
import { conversionUtcDate, base64ToExcelAndDownload } from "@/utils/auth";
import { v4 as uuidv4 } from "uuid";
import { ElMessage, ElMessageBox } from "element-plus";
import { getToken } from "@/utils/auth";
import { message } from "@/utils/message";
import type { ComponentSize, FormInstance, FormRules } from "element-plus";
import { useUserStoreHook } from "@/store/modules/user";
const UserStore = useUserStoreHook();

//表格数据
const Data = ref<any>([
  {
    userid: "admin",
    time: "2024/7/18/13:00",
    data: "新增药品"
  },
  {
    userid: "admin",
    time: "2024/7/18/12:00",
    data: "登录操作"
  },
  {
    userid: "admin",
    time: "2024/7/18/14:00",
    data: "删除药盒配药方案操作"
  },
  {
    userid: "admin",
    time: "2024/7/18/14:00",
    data: "完成配药操作"
  }
]);
const currentPage = ref(1); // 当前页数
const pageSize = ref(10); // 每页条数
const Total = ref<number>(1); //总条数

// 监听页码变化
const handleCurrentChange = val => {
  currentPage.value = val;
  // GetList();
};

// 监听每页条数变化
const handleSizeChange = val => {
  pageSize.value = val;
};
</script>

<template>
  <div>
    <el-row>
      <el-col style="margin-top: 10px">
        <el-table
          class="box-table"
          :data="Data"
          :stripe="true"
          :border="true"
          :fit="true"
        >
          <el-table-column
            prop="userid"
            label="账号"
            width="auto"
            align="center"
            header-align="center"
          >
          </el-table-column>
          <el-table-column
            prop="time"
            label="时间"
            width="auto"
            align="center"
            header-align="center"
          >
          </el-table-column>
          <el-table-column
            prop="data"
            label="操作"
            width="auto"
            align="center"
            header-align="center"
          >
          </el-table-column>
        </el-table>
      </el-col>

      <el-col style="margin: 0 auto">
        <el-card>
          <div class="block">
            <el-pagination
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="currentPage"
              :page-sizes="[10, 20, 30, 40]"
              :page-size="pageSize"
              :total="Total"
            >
            </el-pagination>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<style lang="scss" scoped></style>
